package demo1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by Mikazuki on 2025/3/28.
 */
public class Test {
    // 创建一个spring容器，并且在容器中分别获取User和Person对象，并且调用他们的方法
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("demo1");
        User user = context.getBean(User.class);
        user.sayHello();
        Person person = context.getBean(Person.class);
        person.sayHi();
    }
}
